<script lang="ts" setup>
import { useRouter } from 'vue-router';
import '@vben/styles';
import '@vben/styles/antd';
import { useAccessStore, useUserStore } from '@vben/stores';
import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { BaseHeader } from './components/header';
import { App, ConfigProvider, theme } from 'ant-design-vue';
const router = useRouter();

const handleEvent = (data) => {
  if (data.data === 'system/user') {
    // 已知目标路径（path）时
    const targetPath = '/system/user'; // 替换为实际路径
    const resolvedRoute = router.resolve({
      path: targetPath,
    });
    window.open(resolvedRoute.href, '_blank');
  } else {
    router.push(`/${data.data}`);
  }
};
</script>

<template>
    <Page :auto-content-height="false">

  <a-layout>
    <BaseHeader @nav-click="handleEvent" />
    <a-layout-content>
      <router-view />
    </a-layout-content>
  </a-layout>
</Page>

</template>
<style scoped type="stylus">
.ant-layout-content {
  color: #fff;
  height: calc(100vh - 70px);
  background: #0a1015;
}
</style>
